function Conditions = parameterfunspecial(n,var_num,Pv,Lambdav,b)
Q=ones(var_num-1,1);
for i=1:n
Q(i)=0.5;
end
inc=n;
% for i=1:n
%     for j=1:i
%         inc=inc+1;
%         if i==j 
% %             Q(inc)=1;
%             Q(inc)=1/i;
%         else
% %           Q(inc)=0;
%            Q(inc)=1/i;  
%         end
%     end
% end
for i=1:n
    for j=1:i
        inc=inc+1;
        Q(inc)=b(j)/sum(b(1:i));
    end
end
Conditions= zeros(n,1) ;
for i=1:n-1
    incr=n+(i*(i+1)/2);
    for k=i:n-1
        Conditions(i)= (Pv(k)*Q(k)-Pv(k)-Pv(k+1)*Q(k+1))*Q(incr)+ Conditions(i);
        incr=incr+k-1;
    end 
    Conditions(i)=(Pv(n)*Q(n)-Pv(n)-Pv(1)*Q(1))*Q(incr) +Conditions(i);
    Conditions(i)=Conditions(i)*Lambdav + b(i);
end
incr=var_num-1;
Conditions(n) =Lambdav*(Pv(n)*Q(n)-Pv(n)-Pv(1)*Q(1))*Q(incr) + b(n);
end